package com.zmc.lostfound.auth.vo;

import com.zmc.lostfound.common.constant.RegexConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @author zmc
 * @description 用户更换绑定手机号请求体
 */
@Data
@ApiModel("用户更换绑定手机号请求体")
public class UpdatePhoneVO implements Serializable {

    private static final long serialVersionUID = 6550362248525016590L;

    /**
     * 用户id
     */
    @ApiModelProperty("用户id")
    @NotNull(message = "用户id不能为空")
    @Min(value = 1, message = " 用户id必须大于等于1")
    private Long id;

    /**
     * 手机号
     */
    @ApiModelProperty("手机号")
    @NotBlank(message = "手机号码不能为空")
    @Pattern(regexp = RegexConstant.PHONE_REGEX, message = "手机号码不合法")
    private String phone;

    /**
     * 短信验证码
     */
    @ApiModelProperty("短信验证码")
    @NotBlank(message = "短信验证码不能为空")
    @Pattern(regexp = RegexConstant.CAPTCHA_REGEX, message = "验证码必须由6位数字组成")
    private String captcha;

}
